
<html lang="zh-CN"><head>
    <title>专属客服 {php echo !empty($theme['USERCOMPANYNAME'])?$theme['USERCOMPANYNAME']:$_G['companyname'];}</title>
    {layout name="public/layout" /}
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

    <link href="https://css2019.yixuan.net/baom/template/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://css2019.yixuan.net/baom/template/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://css2019.yixuan.net/baom/template/css/alongsty.css" rel="stylesheet">
    <style type="text/css">
   
        body{ background:#eeeeee;  font-family:"微软雅黑"； }
        input[type="text"],input[type="password"],input[type="date"],input[type="month"],input[type="month"],input[type="time"],input[type="week"],input[type="email"],select{border:none; outline:none; transition:border 0.2s ease-in 0s;  }
        input[type="button"],input[type="submit"]{outline:none;cursor:pointer;border:none;}     input[type="text"]:focus,input[type="password"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="email"]:focus,select:focus{border:1px solid #17a862;  }
       
    </style>
</head>
  <body>
    <div class="toper navbar-fixed-top">
        <div class="row color_white ">
          <div class="col-xs-2" style="padding-left:25px;"></div>
          <div class="col-xs-8 text-center font20">{php echo !empty($theme['keyword'])?'我为'.$theme['keyword'].'代言':'专属客服';}</div>
          <div class="col-xs-2">
          </div>
        </div>
    </div><!-- toper -->
    <div class="height53"></div>
    <input type="hidden" id="themeid" value="{$theme['id']}">
    <div class="height10"></div>
    <div class=" width100 bg_white" style="padding:10px;">
        <div class="media">
            <div class="media-left">
              <a href="#"><div class="photo_80"><img src="{$fans['headimgurl']}" class="img-rounded"></div></a>
            </div>
            <div class="media-body">
              <h4 class="media-heading">{$theme['title']}</h4>
              <p class=" color_gray font16">{php echo mb_substr($theme['desc'],0,60,'utf-8');}</p>
            </div>
        </div>
    </div>
    <div class="height10"></div>
    {if (!empty($myworker['username']) && !empty($_G['URL']['QRURLNEW']))}
    <div class="width100 bg_white" style="padding:10px;height:220px;text-align: center;">
        <img src="{$_G['URL']['QRURLNEW']}{php echo urlencode($workerurl);}">
    </div>
    {/if}
    <div class="height10"></div>
  {php $zidiyiurl = $_G['siteroot'].createMobileUrl("addworker",array("themeid"=>$themeid));}
          <form class="form-horizontal" action="{$zidiyiurl}" method="post" >
        {if (!empty($myworker['username']))}
            <div class="form-group">
              <label for="inputEmail3" class="col-sm-2 control-label">群发网址：(用于文字群发或群发软件群发)</label>
              <div class="col-sm-10">
                <input type="text" class="form-control" id="workerurl" name="workerurl" value="{php echo str_replace("http://","",$workerurl);}" placeholder="用于文字群发或群发软件群发">
              </div>
            </div>
        {/if}
        <div class="form-group">
          <label for="inputEmail3" class="col-sm-2 control-label">所属商家：</label>
          <div class="col-sm-10">
              <select id="company" name="company" >
                  <option value="0">请选择您所在的商家</option>

                  {loop $shoplist $row}
                  <option value="{$row['id']}" {php echo $row['id']==$myworker['company']?'selected':'';}>{$row['name']}</option>
                  {/loop}
              </select>

          </div>
        </div>
        <div class="form-group">
          <label for="inputEmail3" class="col-sm-2 control-label">昵称：</label>
          <div class="col-sm-10">
            <input type="text" class="form-control" id="username" name="username" value="{$myworker['username']}" placeholder="客户一般怎么称呼你? 如:阿涛">
          </div>
        </div>
        <div class="form-group">
          <label for="inputPassword3" class="col-sm-2 control-label">电话：</label>
          <div class="col-sm-10">
            <input type="text" class="form-control" id="mobile" name="mobile" value="{$myworker['mobile']}"  placeholder="客户能联系到你的电话">
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <input type="hidden" name="op" value="save">
            {if (!empty($myworker['username']))}
            <button class="btn btn-default" onclick="return domakeloginshare()">修改信息</button>
            <a class="btn btn-warning" href="{$workerurl}" style="color: #ffffff">打开活动链接,开始邀约 >></a>
            {else}
            <button class="btn btn-default" onclick="return domakeloginshare()">添加员工信息</button>
            {/if}
            <p class="help-block">昵称、电话将出现在活动链接中.</p>
            <p class="help-block">提交后可在本页面,活动二维码下方,再次修改</p>
          </div>
        </div>
      </form>

<link rel="stylesheet" type="text/css" href="https://css2019.yixuan.net/baom/template/css/dsdialog.css">
<script type="text/javascript" src="https://css2019.yixuan.net/baom/template/js/dsdialog.js"></script>
<script type="text/javascript">
function domakeloginshare(){
  var username = $('#username').val();
  var mobile = $("#mobile").val();
  if(username.length == 0){
    ds.dialog({
      title : '&#25805;&#20316;&#25552;&#31034;',
      content : '&#35831;&#36755;&#20837;您的昵称',
      yesText : '&#30830;&#23450;',
        timeout :2.5,
    });
    return false;
  }
  if(mobile.length < 7){
    ds.dialog({
      title : '&#25805;&#20316;&#25552;&#31034;',
      content : '&#35831;&#36755;&#20837;正确电话号码',
      yesText : '&#30830;&#23450;',
        timeout :2.5,
    });
    return false;
  } 
    return true;
}

  </script>
 <style>
  .mod_tips_popup {
  opacity: 0;
  -webkit-transition: all linear 0.2s;
  z-index: -1;
  position: fixed;
  left: 28%;
  top: 20%;
  box-sizing: border-box;
  width: auto;
  padding: 15px;
  margin-left: auto;
  border-radius: 10px;
  background-color: rgba(0,0,0,0.83)
}
  .mod_tips_popup.mod_tips_popup_show {
  opacity: 1;
  z-index: 10000
  }
  
  </style>
    <div id="Mpopup14618046251102">
      <div id="pup" class="mod_tips_popup">
        <div class="mod_tips_cnt">
          <div class="J_tips_content" style="color: #fff;" id="info"></div>
        </div>
        <div class="mod_tips_ft">
        </div>
      </div>
    </div>
<script>
function tips(content){
  $("#info").html(content);
  $("#pup").addClass("mod_tips_popup_show");
  setTimeout('$("#pup").removeClass("mod_tips_popup_show")',2000); 
  
}

function alertToUrl(info,url) {
  tips(info);
    setTimeout("window.location.href='" + url + "'", 2000);
  }
</script>
</body>
<script type="text/javascript" src="https://css2019.yixuan.net/baom/template/js/jquery.min.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
  <script>
        var appid = '{$_G['platform']['jssdkconfig']['appId']}';
        var timestamp = '{$_G['platform']['jssdkconfig']['timestamp']}';
        var nonceStr = '{$_G['platform']['jssdkconfig']['nonceStr']}';
        var signature = '{$_G['platform']['jssdkconfig']['signature']}';

        wx.config({
            debug: false,
            appId: appid,
            timestamp: timestamp,
            nonceStr: nonceStr,
            signature: signature,
            jsApiList: [
                'checkJsApi',
                'hideOptionMenu',
                
            ]
        });


        wx.ready(function () {
          wx.hideOptionMenu();
          // 提交金额
          $(".verifyshare").click(function() {
            var themeid = $("#themeid").val();
          {php $zidiyiurl = "/" . createMobileUrl("verifyshare");}
          
              $.ajax({
               type:'POST',
               data:{themeid:themeid},
               url:'{php echo $zidiyiurl;}',
               success:function(data){
                  var json = eval("("+data+")");
                  if(json.errcode == 0){
                  alertToUrl(json.msg,window.location.href);
                  }else{   
                  tips(json.errmsg);
                  }
               }
             });
          });
          $(".verifyorder").click(function() {
            var themeid = $("#themeid").val();
          {php $zidiyiurl = "/" . createMobileUrl("verifyorder");}
          
              $.ajax({
               type:'POST',
               data:{themeid:themeid},
               url:'{php echo $zidiyiurl;}',
               success:function(data){
                  var json = eval("("+data+")");
                  if(json.errcode == 0){
                  alertToUrl(json.msg,window.location.href);
                  }else{   
                  tips(json.errmsg);
                  }
               }
             });
          });
          
        });

        wx.error(function (res) {
        });
    

    


    </script>
</html>